package strategy

// ParamStrategy1 默认管线参数策略
type ParamStrategy1 struct {
	Env    string `json:"env"`
	Branch string `json:"BRANCH"`
	Action string `json:"deploy_env"`
}

// NewParamStrategy1 策略参数顺序为env, branch, action
func NewParamStrategy1(env string, branch string, action string) *ParamStrategy1 {
	return &ParamStrategy1{Env: env, Branch: branch, Action: action}
}

// ToMap 方法将结构体转换为 map
func (p *ParamStrategy1) ToMap() map[string]string {
	return map[string]string{
		"env":        p.Env,
		"BRANCH":     p.Branch,
		"deploy_env": p.Action,
	}
}

func (p *ParamStrategy1) ToMapByCD() map[string]string {
	return map[string]string{
		"env":        p.Env,
		"deploy_env": p.Action,
	}
}
